#include "detk/file.h"

/** This function returns a pointer to the base name of a file path. */
const char *mx_basename(const char *fname)
{
	const char *base = fname;

/**author basename taken from the <a href="http://www.delorie.com/djgpp/">DJGPP</a> sources. */

	if (fname && *fname) {
		if (fname[1] == ':') {
			fname += 2;
			base = fname;
		}

		while (*fname) {
			if (*fname == '\\' || *fname == '/')
				base = fname + 1;
			fname++;
		}
	}
	return base;
}
